def quickSort(list) {
	if (list.size() < 2) return list

	def pivot = list[list.size().intdiv(2)]
	def left = list.findAll {item -> item < pivot }
	def middle = list.findAll {item -> item == pivot }
	def right = list.findAll {item -> item > pivot }

	return (quickSort(left) + middle + quickSort(right))
}

list = [ 5,3,7,8,2,8,3,7,5,8,2,6,7,8,2,6,8,2,8,2,8,9,2,8,9]

println(quickSort(list))

throw new java.security.InvalidKeyException("my message");
